#!/bin/sh
export TCGPATH=/opt/tcg
SWTPMPATH=$TCGPATH/swTPM
TPMDEVPATH=$TCGPATH/tpmd_dev
export TPM_SERVER_PORT=$1
export TPM_SERVER_NAME=127.0.0.1
export TPM_PORT=$1
export TPM_PATH=$SWTPMPATH/tpmdata/$1
#$SWTPMPATH/tpm/tpm_server &>tpm.log &
#sleep 1
#$SWTPMPATH/libtpm/utils/tpminit 
#$SWTPMPATH/libtpm/utils/tpmbios 
sudo killall tpm_server
sudo killall tcsd
sudo rmmod tpmd_dev
sleep 2
$SWTPMPATH/tpm/tpm_server &>tpm.log &
sleep 1
$SWTPMPATH/libtpm/utils/tpmbios 
cd $TPMDEVPATH
source ./load_tpmd_dev.sh $1
sudo tcsd
cd -
cd example
./TESI_test -v 1.2
cd -

